<template>
  <el-popover v-model="visible2" placement="bottom" trigger="click" width="220">
    <el-tree
      :data="treeData"
      :expand-on-click-node="false"
      :props="defaultProps"
      :default-expand-all="true"
      @node-click="handleNodeClick"
    />
    <el-input slot="reference" :value="inputVal" />
  </el-popover>
</template>

<script>
export default {
  props: ['treeData', 'defaultProps', 'inputVal'],
  data() {
    return {
      visible2: false
    }
  },
  methods: {
    handleNodeClick(data) {
      this.$emit('emitData', data)
      this.visible2 = false
    }
  }
}
</script>

<style>
</style>
